<?php

namespace App\Http\Resources\nursery;

use App\Models\goods\Goods;
use App\Models\goods\OrderGroup;
use App\Models\nursery\Check;
use Illuminate\Http\Resources\Json\Resource;

class CheckResource extends Resource
{

    protected $majorList = [];
    public function __construct($resource,$majorList)
    {
        $this->resource = $resource;
        $this->majorList = $majorList;
    }

    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request $request
     * @return array
     */
    public function toArray($request)
    {

        return [
            'id' => $this->resource->id??0,
            'user_id' => $this->resource->user_id??0,
            'real_name' => $this->resource->real_name??'',
            'sex' => $this->resource->sex??0,
            'age' => $this->resource->age??0,
            'job_age' => $this->resource->job_age??0,
            'card' => $this->resource->card??'',
            'service_area' => $this->resource->service_area??'',
            'majors' => $this->resource->majors??[],
            'brief' => $this->resource->brief??'brief',
            'imgs' => $this->resource->imgs??[],
            'remark' => $this->resource->remark??'',
            'status' => $this->resource->status??0,
            'majorList' => $this->majorList
        ];
    }
}
